package com.settlement.system.mapper;

import com.settlement.system.model.entity.common.SinglePage;
import com.settlement.system.model.entity.common.TblWpAuditStaticDtl;
import com.settlement.system.model.entity.common.TblWpAuditStaticDtlSummary;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.ResultHandler;

import java.util.List;
import java.util.Map;

/**
 * wp-稽核明细 Mapper 接口
 *
 * @author xiaochuan
 * @since 2020-11-25
 */
public interface TblWpAuditStaticDtlMapper extends BaseMapper {

    /**
     * 通过批次号删除数据
     *
     * @param transactionalNo
     * @throws Exception
     */
    public void deleteByTransactionalNo(@Param("transactionalNo") Long transactionalNo) throws Exception;

    /**
     * 通过店铺编码删除数据
     *
     * @param shopNo
     */
    public void deleteByShopNo(@Param("shopNo") String shopNo);

    /**
     * 批量新增
     *
     * @param list
     * @throws Exception
     */
    public void batchAdd(@Param("wpAuditStaticList") List<TblWpAuditStaticDtl> list) throws Exception;

    /**
     * 获取合计
     *
     * @param params 请求参数
     * @return
     */
    public TblWpAuditStaticDtl getFoot(@Param("params") Map<String, Object> params);

    /**
     * getSummaryFoot
     * @param params
     * @return
     */
    public TblWpAuditStaticDtlSummary getSummaryFoot(@Param("params") Map<String, Object> params);

    /**
     * 获取分页列表
     * @param page
     * @param params
     * @param orderByField
     * @param orderBy
     * @return
     */
    public List<TblWpAuditStaticDtlSummary> selectSummaryByPage(@Param("page") SinglePage page, @Param("params") Map<String, Object> params,
                                                                @Param("orderByField") String orderByField, @Param("orderBy") String orderBy);
    
    /**
     * 通过handler 获取数据
     *
     * @param params
     * @param handler
     */
    public void getDataSummaryByHandler(@Param("params") Map<String, Object> params, ResultHandler<TblWpAuditStaticDtlSummary> handler);

    /**
     * 根据查询记录更新存档数据表结果
     * @param params
     */
    void updateArchiveResult(@Param("params") Map<String, Object> params);

}

